package com.denlaku.longan.repository;

import com.denlaku.longan.dao.LexiconItemDao;
import com.denlaku.longan.vo.LexiconItem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author tianx
 */
@Repository
public class LexiconItemRepository {
    @Autowired
    private LexiconItemDao lexiconItemDao;

    /**
     * 添加词条
     *
     * @param lexiconItem 参数
     * @return 添加行数
     */
    public int add(LexiconItem lexiconItem) {
        return lexiconItemDao.add(lexiconItem);
    }

    /**
     * 删除词条
     *
     * @param lexiconItem 参数
     * @return 删除行数
     */
    public int delete(LexiconItem lexiconItem) {
        return lexiconItemDao.delete(lexiconItem);
    }

    /**
     * 获取词条
     *
     * @param query 参数
     * @return 词条
     */
    public LexiconItem get(LexiconItem query) {
        return lexiconItemDao.get(query);
    }

    /**
     * 查询词条列表
     *
     * @param query 查询参数
     * @return list
     */
    public List<LexiconItem> list(LexiconItem query) {
        return lexiconItemDao.list(query);
    }
}
